﻿#include<iostream>

using namespace std;

struct Date
{
	int _year;
	int _month;
	int _day;
	Date(int year = 1, int month = 1, int day = 1)
		:_year(year)
		, _month(month)
		, _day(day)
	{
	}
	~Date()
	{
		cout << "~Date()" << endl;
	}
};


int main()
{

	shared_ptr<Date> sp1(new Date);
	// ⽀持拷⻉
	shared_ptr<Date> sp2(sp1);
	shared_ptr<Date> sp3(sp2);

	cout << sp1.use_count() << endl;
	sp1->_year++;
	cout << sp1->_year << endl;
	cout << sp2->_year << endl;
	cout << sp3->_year << endl;
	return 0;
}